/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cip.esymons.tesoreria.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Gilmar Montoya
 */
@Entity
@Table(name = "tes_cierre_documento")
@IdClass(CierreDocumentoPK.class)
public class CierreDocumento implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "cie_codigo", nullable = false, insertable = false, updatable = false)
    private long cieCodigo;
    @Id
    @Column(name = "doc_codigo", nullable = false, insertable = false, updatable = false)
    private long docCodigo;
    @Basic(optional = false)
    @Column(name = "cdo_monto", nullable = false, precision = 11, scale = 4)
    private Double cdoMonto;
    @JoinColumn(name = "cie_codigo", referencedColumnName = "cie_codigo", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CierreCaja cierreCaja;
    @JoinColumn(name = "doc_codigo", referencedColumnName = "fk_doc_codigo", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private DocumentoPago documentoPago;

    public CierreDocumento() {
    }

    public Double getCdoMonto() {
        return cdoMonto;
    }

    public void setCdoMonto(Double cdoMonto) {
        this.cdoMonto = cdoMonto;
    }

    public CierreCaja getCierreCaja() {
        return cierreCaja;
    }

    public void setCierreCaja(CierreCaja cierreCaja) {
        this.cierreCaja = cierreCaja;
    }

    public DocumentoPago getDocumentoPago() {
        return documentoPago;
    }

    public void setDocumentoPago(DocumentoPago documentoPago) {
        this.documentoPago = documentoPago;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.tesoreria.be.CierreDocumento[cieCodigo=" + cieCodigo + ", docCodigo=" + docCodigo + "]";
    }

    /**
     * @return the cieCodigo
     */
    public long getCieCodigo() {
        return cieCodigo;
    }

    /**
     * @param cieCodigo the cieCodigo to set
     */
    public void setCieCodigo(long cieCodigo) {
        this.cieCodigo = cieCodigo;
    }

    /**
     * @return the docCodigo
     */
    public long getDocCodigo() {
        return docCodigo;
    }

    /**
     * @param docCodigo the docCodigo to set
     */
    public void setDocCodigo(long docCodigo) {
        this.docCodigo = docCodigo;
    }
}
